<?php
namespace app\common\component\user_vip;

class UserVipModel extends \think\Model {
	protected $table = 'league_user_vip';
	
	public $remaining_days = 0;
	
	// 计算剩余天数
	public function countRemainingDays() {
		if($this -> days > 0) {			
			$remainingDays = countDays(null, $this -> top_up_time + $this -> days * 24 * 60 * 60);
			$this -> remaining_days = $remainingDays < 0?0:$remainingDays;
		}
	}
}
?>